<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>Canbot Denayer 13/14 - a: Serial Class Reference</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />

<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">Canbot Denayer 13/14 - a
   
   </div>
   
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.6.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="dirs.html"><span>Directories</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">Serial Class Reference</div>  </div>
</div><!--header-->
<div class="contents">
<!-- doxytag: class="Serial" -->
<p>Sets up the serial connection and exposes it to the program.  
 <a href="classSerial.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="Serial_8h_source.html">Serial.h</a>&gt;</code></p>

<p><a href="classSerial-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3667c3137f2df94716b5193f9fb736ab"></a><!-- doxytag: member="Serial::Serial" ref="a3667c3137f2df94716b5193f9fb736ab" args="()" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSerial.html#a3667c3137f2df94716b5193f9fb736ab">Serial</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Set up the serial connection with default values. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSerial.html#ac2aba5762bca2c2f926c33d5a21b30b9">Serial</a> (string dev, int baudrate, int databits, int parity, int stopbits, int flowControl)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Set up serial connection with given parameters.  <a href="#ac2aba5762bca2c2f926c33d5a21b30b9"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a5b32c394c0ff923a4ef1c13cfb20a6ba"></a><!-- doxytag: member="Serial::~Serial" ref="a5b32c394c0ff923a4ef1c13cfb20a6ba" args="()" -->
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSerial.html#a5b32c394c0ff923a4ef1c13cfb20a6ba">~Serial</a> ()</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">This will close the connection gracefully before comitting suicide. <br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSerial.html#a7f79bb6ca645d92d8b596578963348fc">swrite</a> (string command)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Write string to the port.  <a href="#a7f79bb6ca645d92d8b596578963348fc"></a><br/></td></tr>
<tr><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classSerial.html#ac736effc9f9af6edf9dbf6f315a4a287">sread</a> (char *result)</td></tr>
<tr><td class="mdescLeft">&#160;</td><td class="mdescRight">Read from the port.  <a href="#ac736effc9f9af6edf9dbf6f315a4a287"></a><br/></td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>Sets up the serial connection and exposes it to the program. </p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="ac2aba5762bca2c2f926c33d5a21b30b9"></a><!-- doxytag: member="Serial::Serial" ref="ac2aba5762bca2c2f926c33d5a21b30b9" args="(string dev, int baudrate, int databits, int parity, int stopbits, int flowControl)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="classSerial.html#a3667c3137f2df94716b5193f9fb736ab">Serial::Serial</a> </td>
          <td>(</td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"><em>dev</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>baudrate</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>databits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>parity</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>stopbits</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&#160;</td>
          <td class="paramname"><em>flowControl</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Set up serial connection with given parameters. </p>
<p>This will initiate a serial connection to the defined device and use the given parameters as attributes for that connection. The result is a fully configured serial connection which can be written to or read from.</p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">string</td><td>dev The serial device to connect to. </td></tr>
    <tr><td class="paramname">int</td><td>baudrate The baudrate. </td></tr>
    <tr><td class="paramname">int</td><td>databits The number of databits. </td></tr>
    <tr><td class="paramname">int</td><td>parity The use of parity. </td></tr>
    <tr><td class="paramname">int</td><td>stopbits The number of stopbits. </td></tr>
    <tr><td class="paramname">int</td><td>flowControl The use of flow control. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ac736effc9f9af6edf9dbf6f315a4a287"></a><!-- doxytag: member="Serial::sread" ref="ac736effc9f9af6edf9dbf6f315a4a287" args="(char *result)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classSerial.html#ac736effc9f9af6edf9dbf6f315a4a287">Serial::sread</a> </td>
          <td>(</td>
          <td class="paramtype">char *&#160;</td>
          <td class="paramname"><em>result</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Read from the port. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">char*</td><td>result A pointer to the buffer that receives the output. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>The number of bytes read, -1 on error. </dd></dl>

</div>
</div>
<a class="anchor" id="a7f79bb6ca645d92d8b596578963348fc"></a><!-- doxytag: member="Serial::swrite" ref="a7f79bb6ca645d92d8b596578963348fc" args="(string command)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="classSerial.html#a7f79bb6ca645d92d8b596578963348fc">Serial::swrite</a> </td>
          <td>(</td>
          <td class="paramtype">string&#160;</td>
          <td class="paramname"><em>command</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>Write string to the port. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
  <table class="params">
    <tr><td class="paramname">string</td><td>command The command to be written to the port. </td></tr>
  </table>
  </dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>Number of written characters on success, -1 on failure. </dd></dl>

</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>denayer-canbot-13-14-a/src/lowLevel/<a class="el" href="Serial_8h_source.html">Serial.h</a></li>
<li>denayer-canbot-13-14-a/src/lowLevel/<a class="el" href="Serial_8cpp.html">Serial.cpp</a></li>
</ul>
</div><!-- contents -->
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>



<hr class="footer"/><address class="footer"><small>
Generated on Thu Apr 24 2014 11:39:28 for Canbot Denayer 13/14 - a by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.7.6.1
</small></address>

</body>
</html>
